import {createRouter, createWebHashHistory} from 'vue-router'


const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            name: 'login',
            component: () => import('@/views/loginView.vue'),
            children: [
                {
                    name: 'loginComponent',
                    path: 'login',
                    component: () => import('@/components/login/loginComponent.vue'),
                },
                {
                    name: 'registerComponent',
                    path: 'register',
                    component: () => import('@/components/login/registrationComponent.vue')
                }
            ],
            redirect: '/login'
        },
        {
            path: '/home',
            name: 'home',
            component: () => import('@/views/homeView.vue'),
            children: [
                {
                  name: 'default',
                  path: '',
                  component: () => import('@/components/home/content/default.vue')
                },
                {
                    name: 'userInfo',
                    path: 'user',
                    component: () => import('@/components/home/content/information/userInfo.vue')
                },
                {
                    name: 'eventInfo',
                    path: 'event',
                    component: () => import('@/components/home/content/event/eventInfo.vue')
                },
                {
                    name: 'announcementsInfo',
                    path: 'announcements',
                    component: () => import('@/components/home/content/announcement/announcementInfo.vue')
                },
                {
                    name: 'houseInfo',
                    path: 'house',
                    component: () => import('@/components/home/content/information/houseInfo.vue')
                },
                {
                    name: 'repairRegistration',
                    path: 'repairRegistration',
                    component: () => import('@/components/home/content/repair/repairRegistration.vue')
                },
                {
                    name: 'repairInfo',
                    path: 'repairInfo',
                    component: () => import('@/components/home/content/repair/repairInfo.vue')
                }
            ],
            redirect: '/home'
        }

    ]
})

export default router
